cmake_minimum_required(VERSION 2.8.3)
project(waypoint_trajectory_generator)

set (CMAKE_CXX_STANDARD 11)


# set(CMAKE_VERBOSE_MAKEFILE "false")
# include(CheckCXXCompilerFlag)
# CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
# CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
# if(COMPILER_SUPPORTS_CXX11)
#     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
# elseif(COMPILER_SUPPORTS_CXX0X)
#     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
# else()
#         message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
# endif()

# set(ADDITIONAL_CXX_FLAG "-Wall -O3 -march=native") # cmake 有bug
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ADDITIONAL_CXX_FLAG}")

# SET(CMAKE_BUILD_TYPE "Debug")
# SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb")
# SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")


find_package(catkin REQUIRED COMPONENTS
  roscpp
  tf
  nav_msgs
  quadrotor_msgs
)
catkin_package()

find_package(Eigen3 REQUIRED)
set(Eigen3_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR})


find_package(OsqpEigen REQUIRED)

include_directories(include
  	${catkin_INCLUDE_DIRS}
  	${Eigen3_INCLUDE_DIRS}
)

add_executable(trajectory_generator_node 
  src/trajectory_generator_node.cpp
  src/trajectory_generator_waypoint.cpp
)

target_link_libraries(trajectory_generator_node
  ${catkin_LIBRARIES}
  Eigen3::Eigen
  # libquadprog.a
  OsqpEigen::OsqpEigen
  osqp::osqp
)
